<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="华为2020软件精英挑战赛复赛赛后方案分享, 大虫のBlog">
    <meta name="description" content="电子科技大学 | 信软学院 | 软件工程">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>华为2020软件精英挑战赛复赛赛后方案分享 | 大虫のBlog</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 6.2.0"></head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">大虫のBlog</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="" class="waves-effect waves-light">

      
      <i class="fa fa-list" style="zoom: 0.6;"></i>
      
      <span>其他</span>
      <i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
    </a>
    <ul class="sub-nav menus_item_child ">
      
      <li>
        <a target="_blank" rel="noopener" href="https://console.leancloud.cn">
          
          <i class="fa-solid fa-link" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>LeanCloud 应用</span>
        </a>
      </li>
      
      <li>
        <a target="_blank" rel="noopener" href="https://www.tidio.com/panel">
          
          <i class="fa-solid fa-link" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>TIDIO 聊天系统</span>
        </a>
      </li>
      
      <li>
        <a target="_blank" rel="noopener" href="https://www.coderutil.com">
          
          <i class="fa-solid fa-link" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>CoderUtil 工具</span>
        </a>
      </li>
      
    </ul>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">大虫のBlog</div>
        <div class="logo-desc">
            
            电子科技大学 | 信软学院 | 软件工程
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="javascript:;">
			
				<i class="fa-fw fa fa-list"></i>
			
			其他
			<span class="m-icon"><i class="fas fa-chevron-right"></i></span>
		</a>
            <ul  style="background:  ;" >
              
                <li>

                  <a target="_blank" rel="noopener" href="https://console.leancloud.cn " style="margin-left:75px">
				  
				   <i class="fa fa-solid fa-link" style="position: absolute;left:50px" ></i>
			      
		          <span>LeanCloud 应用</span>
                  </a>
                </li>
              
                <li>

                  <a target="_blank" rel="noopener" href="https://www.tidio.com/panel " style="margin-left:75px">
				  
				   <i class="fa fa-solid fa-link" style="position: absolute;left:50px" ></i>
			      
		          <span>TIDIO 聊天系统</span>
                  </a>
                </li>
              
                <li>

                  <a target="_blank" rel="noopener" href="https://www.coderutil.com " style="margin-left:75px">
				  
				   <i class="fa fa-solid fa-link" style="position: absolute;left:50px" ></i>
			      
		          <span>CoderUtil 工具</span>
                  </a>
                </li>
              
            </ul>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://gitee.com/yczlab" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://gitee.com/yczlab" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/7.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">华为2020软件精英挑战赛复赛赛后方案分享</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/%E6%AF%94%E8%B5%9B/">
                                <span class="chip bg-color">比赛</span>
                            </a>
                        
                            <a href="/tags/C/">
                                <span class="chip bg-color">C++</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/%E6%AF%94%E8%B5%9B/" class="post-category">
                                比赛
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-05-17
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2022-07-31
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    7.5k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    36 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="引言："><a href="#引言：" class="headerlink" title="引言："></a>引言：</h2><blockquote>
<p>我是来自成渝赛区UESTC的选手，成渝赛区初赛成绩为0.5646s，当时以为不能晋级复赛，就忘了组队。这里分享我复赛时的方案和代码，复赛练习时成绩为12.1534s，正式复赛时成渝赛区排名21，成功拿到手环（我已经很满足了）。本篇博客对于前排大佬来说毫无用处，仅适用于后排同学一起学习进步。</p>
</blockquote>
<h3 id="1-复赛练习-赛题介绍"><a href="#1-复赛练习-赛题介绍" class="headerlink" title="1. 复赛练习-赛题介绍"></a>1. 复赛练习-赛题介绍</h3><h3 id="1-1-输入信息"><a href="#1-1-输入信息" class="headerlink" title="1.1 输入信息"></a>1.1 输入信息</h3><p>输入为包含资金流水的文本文件，每一行代表一次资金交易记录，包含本端账号ID, 对端账号ID, 转账金额，用逗号隔开。</p>
<ul>
<li>本端账号ID和对端账号ID为一个32为的无符号整数</li>
<li>转账金额为一个32位的正整数</li>
<li>账记录最多为200万条</li>
<li>账号A给账号B最多转账一次</li>
</ul>
<p>输入文件举例如下，其中第一行[1,2,100]表示ID为1的账户给ID为2的账户转账100元：<br>1,2,100<br>1,3,100<br>2,4,90<br>3,4,19<br>4,1,95<br>2,5,95<br>5,4,90<br>4,6,30<br>6,7,29<br>7,4,28</p>
<h3 id="1-2-输出要求"><a href="#1-2-输出要求" class="headerlink" title="1.2 输出要求"></a>1.2 输出要求</h3><p>输出信息为一个文件，包含如下信息:</p>
<ul>
<li>第一行输出：满足限制条件下的循环转账个数。线上数据集经过处理，会保证满足条件的循环转账个数小于2000万。</li>
<li>第二行开始：输出所有满足限制条件的循环转账路径详情。输出的循环转账路径要按照指定排序策略进行排序：每条循环转账中，ID（ID转为无符号整数后）最小的第一个输出；总体按照循环转账路径长度升序排序；同一级别的路径长度下循环转账账号ID序列，按照字典序（ID转为无符号整数后）升序排序。</li>
</ul>
<p>输出举例如下：<br>3<br>1,2,4<br>4,6,7<br>1,2,5,4</p>
<h3 id="1-3-限制条件"><a href="#1-3-限制条件" class="headerlink" title="1.3 限制条件"></a>1.3 限制条件</h3><ul>
<li>循环转账的路径长度最小为3（包含3）最大为7（包含7），例如：账户A给账户B转账，账户B给账户A转账。循环转账的路径长度为2，不满足循环转账条件。</li>
<li>转账金额浮动区间约束为[0.2, 3] ：循环转账的前后路径的转账金额浮动，不能小于0.2，不能大于3。如账户A转给账户B 转X元，账户B转给账户C转Y元， 那么进行循环检测时，要满足0.2 &lt;&#x3D; Y&#x2F;X &lt;&#x3D; 3的条件。</li>
</ul>
<h3 id="2-复赛练习-方案思路"><a href="#2-复赛练习-方案思路" class="headerlink" title="2. 复赛练习-方案思路"></a>2. 复赛练习-方案思路</h3><h4 id="2-1-算法整体框架"><a href="#2-1-算法整体框架" class="headerlink" title="2.1 算法整体框架"></a>2.1 算法整体框架</h4><ul>
<li>第一步：使用mmap读取文件并解析好数据，对账户ID做好<strong>id映射</strong></li>
<li>第二步：构建正向图和反向图，为以下算法打好基础</li>
<li>第三步：利用正向图和反向图双向dfs（双向深度搜索），外加多线程并行寻环，同时往结果char数组中写入结果</li>
<li>第四步：将char数组的结果写入文件</li>
</ul>
<h4 id="2-2-算法讲解"><a href="#2-2-算法讲解" class="headerlink" title="2.2 算法讲解"></a>2.2 算法讲解</h4><p>以上的步骤中第三步是重点，但是每一步都必不可少（感觉像是在说废话）。</p>
<h5 id="2-2-1-前菜"><a href="#2-2-1-前菜" class="headerlink" title="2.2.1 前菜"></a>2.2.1 前菜</h5><p>首先提出一些问题和解决方案，针对这些问题，估计大家都是这么解决的。</p>
<pre class="language-text" data-language="text"><code class="language-text">1、能不能在寻环的过程中，就能保证环的起点是最小ID值
2、能不能在寻环结束之后，就能保证全部的环是按照长度为第一优先，字典序为第二优先级排好序</code></pre>
<p>这两个问题能节省很多多余的操作，并且大部分选手都能解决，所以我还是先从这两个问题开头吧！<br>这里先介绍一些约定的符号：</p>
<ul>
<li>N：表示不重复的账户个数，即节点数</li>
<li>i：表示账户ID值映射到 0~(N-1) 之间，i∈{0,1,2,…,N-1}，这里可以理解为每个账户ID存放在数组中的位置，从0开始</li>
<li>ID：表示账户(节点)原始的ID，来自于原始的文件数据</li>
</ul>
<p>针对第一个问题，如果dfs遍历到账户ID为5-&gt;4-&gt;6-&gt;3的环，那么按照赛题的限制要求，我们应该按照3-&gt;5-&gt;4-&gt;6的顺序输出，因为环中的最小ID要放在最前面。那么其实当我们以某个账户ID为起始节点开始dfs时，只要控制后续遍历的ID值是大于这个开始节点的，那么就能保证找到的环都是满足起点是最小ID值。比如：当我们开始寻找以ID为3作为起点的环时，只要控制后续遍历的ID值是大于3的，那么找到的环都是满足起点是最小ID值3。然后再继续寻找以账户ID为4作为起点的环……</p>
<p>针对第二个问题，可以在找完所有的环后，做一个排序。但是其实在dfs遍历寻环的过程中就可以保证其满足字典序。首先对账户ID值做一个排序，保证ID值的相对顺序和ID映射之后的相对顺序一致。比如说有4个账户ID：{5, 11, 8, 13}，如果说按照先后出现的顺序做映射，那么将会映射成 ID-&gt;i：{5-&gt;0, 11-&gt;1, 8-&gt;2, 13-&gt;3}。试想，寻找以i为起点的环，i从0~(N-1)变化，当i为0时，开始找以5为起点的环，然后是以11为起点的环，再然后是以8为起点的环。那这样，全部的环排列当然是无序的。但是如果先对所有的ID排个序，再做映射，ID-&gt;：{5-&gt;0, 8-&gt;1, 11-&gt;2, 13-&gt;3}，其中{5, 8, 11, 13}和{0, 1, 2, 3}的相对大小顺序是相同时。那么在挨个寻环的过程中，环的起点是按顺序排的，但是相同长度的环并非按照字典序排的，这里需要在建图时将每个节点的邻居节点排序，在dfs搜索每个节点的邻居节点时才能保证从小到大的顺序，从而保证找到的环按字典序排好序。这里需要注意的是，要为找到的长度为3，4，5，6，7的环分别建立容器去存储。例如检测到长度为3的环，那么就写到对应的容器中。这个容器可以是int数组，也可以是char数组。</p>
<h5 id="2-2-2-中菜"><a href="#2-2-2-中菜" class="headerlink" title="2.2.2 中菜"></a>2.2.2 中菜</h5><p>由于不知道线上数据集的大小，而且复赛规则中取消了每个节点的平均度为10的这个条件，所以图的数据结构，用<code>vector&lt;Node&gt;</code>作为邻接表，用<code>vecotr&lt;Node&gt; G[N]</code>作为整个图，用<code>vector&lt;Node&gt; RG[N]</code>作为反向图（具体请参照后面的代码）。</p>
<ul>
<li>反向图：如果i直接连接到j，那么记录下有哪些节点和j存在以j为终点的直接连接，同样是一个邻接表，只不过是反向记录的。反向图的好处是很大的，可以帮助dfs执行的更快。</li>
</ul>
<h5 id="2-2-3-压轴菜"><a href="#2-2-3-压轴菜" class="headerlink" title="2.2.3 压轴菜"></a>2.2.3 压轴菜</h5><h6 id="2-2-3-1-利用正向图和反向图双向dfs寻环"><a href="#2-2-3-1-利用正向图和反向图双向dfs寻环" class="headerlink" title="2.2.3.1 利用正向图和反向图双向dfs寻环"></a>2.2.3.1 利用正向图和反向图双向dfs寻环</h6><p>如果使用dfs寻找长度为7的环，最大递归深度为7，在面对线上如此大的数据集的时候，这个深度可以说非常深，因为层次越大，遍历的节点数目呈指数级上升。能不能不遍历这么多层就可以知道有没有环呢？数组7的最大平均拆分是4+3或者3+4，群里很多选手都说自己的方案是4+3或者几+几。这些数字的意义是啥。见下图：<br><img src="/posts/4c44f972/1.png" alt="image"><br>这里有一个环：1-&gt;5-&gt;3-&gt;4-&gt;2-&gt;6-&gt;7，起点为1。<br>对于一个环来说，从某个位置往后继节点的位置走，和往反方向走，一定会碰到一起。比如1往后继节点走4步到2，然后1反方向走3步也能到2。所以我们可以设置正向dfs递归深度为4，反向dfs递归深度为3。当开始寻找以i为起点的环时，可以先反向走3步，构建能到i能到达的反向路径，用ptp2存这样的路径，转账数额也一同存入；用ptp1存从i反向走2步能到达的反向路径，同样转账数额也一同存入。然后开始从i出发，正向开始遍历，假设第一层dfs遍历到节点k，那么目前的路径为i-&gt;k。假设i存在一个长度为3的环{i, k, n}，i反向走2步也是到k。而我们已经用ptp1记录了从i反向走两步的所有路径，如果这些路径中存在以k为起点的路段，那我们就找到了一个以i为起点，长度为3的环。接下来，再往后继节点走一步，我们可以通过ptp1获得长度为4的环，通过ptp2获得长度为5的环；再往后继节点走一步，通过ptp2获得长度为6的环；在往后继节点走一步，通过ptp2获得长度为7的环。在进行dfs遍历时，同时要判断转账金额是否满足关于赛题中转账金额的浮动约束。至于如何使用ptp1，ptp2，可以见开源代码部分。</p>
<p>所以整个寻环算法的过程看起来如下：<br><img src="/posts/4c44f972/2.png" alt="image"></p>
<h6 id="2-2-3-2-双线程并行寻环"><a href="#2-2-3-2-双线程并行寻环" class="headerlink" title="2.2.3.2 双线程并行寻环"></a>2.2.3.2 双线程并行寻环</h6><p>很多选手说并行执行是负优化或者提升不大，很可能是没考虑到线程的工作量是否均衡。还有选手说使用并行就result is incorrect，也有可能是每个线程的数组不够大，有些数组被撑爆了，从而导致丢了答案。</p>
<p>前排大佬很可能开了很多线程去同时工作，但是分配给每个线程的工作量必须要均衡，不然很可能工作量少的线程运行完退出后，工作量大的线程还在工作，导致最终算法的执行时间和取决于工作量大的线程的运行时间。</p>
<p>由于摸不透线上数据的分布，所以对于我这种小菜鸟只能勉强使用双线程去实现。一个线程从前往后寻环，另一个线程从后往前寻环，这样两个线程在中间某个节点会碰到一起，此时两个线程的运行时间会差不多，工作量也差别不大。相比于单线程，差不多能提高一倍的成绩。<br>双线程并行寻环的过程看起来如下：<br><img src="/posts/4c44f972/3.png" alt="image"><br><strong>说明1：</strong>这里要注意线程2是从大到小寻环，所以在存环的时候也要倒着走，并且在遍历邻居节点时也要倒着遍历。比如我们创建了10M的字符数组<code>char buf3[10*1024*1024]</code>来存放长度为3的环。线程1找到长度为3的环时从buf3的头向尾写入结果，线程2找到长度为3的环时从buf3的尾向头写入结果。其他长度的环同理，为什么这么做，是为了在之后写文件时更快且保证结果排序的正确性。具体请参照代码。</p>
<p><strong>说明2：</strong>这里的结束位置肯定是偏左的，因为线程2寻环的首节点id比较大，所以在dfs遍历过程中比这个首节点id大的节点比较少，所寻找的满足条件的环也比较少，可能递归深度没有达到最大就结束了，然后向左移动寻找以id-1为首节点的环。比如，线程2刚开始寻找以最后一个节点为首的环，其实根本找不到满足赛题条件的环，因为其id最大，所以就不可能出现在环首，很快就跳过了最后一个节点。然而线程1是以一个较小的id开始，有较多的节点都比这个id大，所以在遍历过程中比较慢。线程1向右移动的速度比线程2向左移动的速度慢，导致结束位置偏左。正因为以每个节点为首的寻环过程时间开销很难确定，所以想要手动给每个线程提前分配任务就很难做到均分。比如手动将节点数对半分给两个线程，必然是不科学的，并不能达到很好的效果。只有用以上的方法让两个线程自己去把握这个结束位置才能达到较好的效果。当然前排大佬可能使用了更多的线程，任务的分配就更加的复杂，可能使用了自己的调度算法，我这种菜鸟是学不来的，只能做到双线程。</p>
<h3 id="3-各种细节"><a href="#3-各种细节" class="headerlink" title="3. 各种细节"></a>3. 各种细节</h3><h4 id="3-1-IO篇"><a href="#3-1-IO篇" class="headerlink" title="3.1 IO篇"></a>3.1 IO篇</h4><ul>
<li>读数据的时候，顺便把i对应的ID值的字符形式表示出来。有两种办法，第一种，直接从mmap映射到的字符串中截取出来。第二种，自己写个to_char函数，把整型转换为char*，方便写入。我使用的是后者。</li>
<li>写入数据直接往字符数组中写，还利用了多线程，那就相当于同时并行处理了写入数据。</li>
<li>fwrite和mmap到底谁快，有的人说fwrite快，有的人说mmap快。我用的是mmap。对于IO的优化反正对于线上结果影响还挺大的。</li>
</ul>
<h5 id="3-2-DFS篇"><a href="#3-2-DFS篇" class="headerlink" title="3.2 DFS篇"></a>3.2 DFS篇</h5><ul>
<li>前向dfs只要走4步，用5层for循环嵌套的效率远远低于递归写法</li>
<li>调整if else if的顺序，把经常发生的情况写在前面，另外switch case的效率高于if else if</li>
<li>函数中尽量不要带形参，需要带形参的可以设置为全局变量。</li>
<li>根据官方微信推送的优化思路，用一些临时变量有助于减少寻址。</li>
</ul>
<h3 id="4-正式复赛-赛题介绍"><a href="#4-正式复赛-赛题介绍" class="headerlink" title="4. 正式复赛-赛题介绍"></a>4. 正式复赛-赛题介绍</h3><p>变更一：</p>
<ul>
<li>循环转账的路径长度最小为3（包含3）最大为8（包含8）</li>
</ul>
<p>变更二：</p>
<ul>
<li>转账金额变更为浮点数：整数部分大于0，小于2的31次方；小数部分用小于等于2位数的数字表示。如下方式都是正确的表示</li>
<li>整数部分.YY 如 1000.53  1000.50 1000.00</li>
<li>整数部分.Y  如 1000.5  1000.0</li>
<li>整数部分 如 1000</li>
</ul>
<p>正式复赛要求在两个半小时之内提交结果，有五次提交机会，我太菜了提交了3次都是0%result is incorrect</p>
<p>整体算法思路都以上的思路，采用单线程实现的，由于没有成绩，不知道代码哪个地方有问题，经供参考学习。</p>
<h3 id="5-赛后感受"><a href="#5-赛后感受" class="headerlink" title="5. 赛后感受"></a>5. 赛后感受</h3><ul>
<li>细节决定排名</li>
<li>算法虽好，也要看实现方式（数据结构尽量用数组，new和vector是真的慢）</li>
<li>C++强无敌，前排没有一个使用python和java的</li>
</ul>
<h3 id="6-代码开源"><a href="#6-代码开源" class="headerlink" title="6. 代码开源"></a>6. 代码开源</h3><ul>
<li><a href="4c44f972/main.rar">复赛练习 main.cpp</a></li>
<li><a href="4c44f972/test.rar">正式复赛 test.cpp</a></li>
<li><a href="4c44f972/%E5%A4%8D%E8%B5%9B%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE.rar">测试数据</a></li>
<li><a href="4c44f972/%E7%AE%97%E6%B3%95%E5%88%86%E6%9E%90.pptx">算法分析.pptx</a></li>
</ul>
<h3 id="7-复赛练习-main-cpp"><a href="#7-复赛练习-main-cpp" class="headerlink" title="7. 复赛练习 main.cpp"></a>7. 复赛练习 main.cpp</h3><pre class="language-cpp" data-language="cpp"><code class="language-cpp"><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;bits/stdc++.h></span></span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;unistd.h></span></span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;fcntl.h></span></span>
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span> <span class="token string">&lt;sys/mman.h></span></span>

<span class="token keyword">using</span> <span class="token keyword">namespace</span> std<span class="token punctuation">;</span>

string testFile <span class="token operator">=</span> <span class="token string">"test_data.txt"</span><span class="token punctuation">;</span>
string resultFile <span class="token operator">=</span> <span class="token string">"rslt.txt"</span><span class="token punctuation">;</span>

<span class="token keyword">typedef</span> <span class="token keyword">struct</span> <span class="token class-name">Node</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">int</span> id<span class="token punctuation">;</span>
	uint money<span class="token punctuation">;</span>
	<span class="token keyword">bool</span> <span class="token keyword">operator</span><span class="token operator">&lt;</span><span class="token punctuation">(</span><span class="token keyword">const</span> Node <span class="token operator">&amp;</span>other<span class="token punctuation">)</span><span class="token keyword">const</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">return</span> id<span class="token operator">&lt;</span>other<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token keyword">bool</span> <span class="token keyword">operator</span><span class="token operator">==</span><span class="token punctuation">(</span><span class="token keyword">const</span> Node <span class="token operator">&amp;</span>other<span class="token punctuation">)</span><span class="token keyword">const</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">return</span> id<span class="token operator">==</span>other<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>Node<span class="token punctuation">;</span>

<span class="token comment">/*构建图需要的变量*/</span>
<span class="token keyword">int</span> account_num <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
uint inputs<span class="token punctuation">[</span><span class="token number">2</span><span class="token operator">*</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
uint accts<span class="token punctuation">[</span><span class="token number">2</span><span class="token operator">*</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> G<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> RG<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>

<span class="token comment">/*存放每个账户ID的字符串*/</span>
<span class="token keyword">char</span> account_chars<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">12</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">short</span> length<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>

<span class="token comment">/*存放结果*/</span>
<span class="token keyword">char</span> buf3<span class="token punctuation">[</span><span class="token number">64</span><span class="token operator">*</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token operator">*</span>hf3<span class="token punctuation">,</span> <span class="token operator">*</span>tf3<span class="token punctuation">;</span>   <span class="token comment">// 64M //线程1通过hf3(head of buf3)从前往后写，线程2通过tf3(tail of buf3)从后往前写</span>
<span class="token keyword">char</span> buf4<span class="token punctuation">[</span><span class="token number">64</span><span class="token operator">*</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token operator">*</span>hf4<span class="token punctuation">,</span> <span class="token operator">*</span>tf4<span class="token punctuation">;</span>   <span class="token comment">// 64M</span>
<span class="token keyword">char</span> buf5<span class="token punctuation">[</span><span class="token number">64</span><span class="token operator">*</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token operator">*</span>hf5<span class="token punctuation">,</span> <span class="token operator">*</span>tf5<span class="token punctuation">;</span>   <span class="token comment">// 64M</span>
<span class="token keyword">char</span> buf6<span class="token punctuation">[</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token operator">*</span>hf6<span class="token punctuation">,</span> <span class="token operator">*</span>tf6<span class="token punctuation">;</span> <span class="token comment">// 1024M</span>
<span class="token keyword">char</span> buf7<span class="token punctuation">[</span><span class="token number">1468</span><span class="token operator">*</span><span class="token number">1024</span><span class="token operator">*</span><span class="token number">1024</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token operator">*</span>hf7<span class="token punctuation">,</span> <span class="token operator">*</span>tf7<span class="token punctuation">;</span> <span class="token comment">// 1468M</span>
<span class="token keyword">int</span> r3_1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r4_1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r5_1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r6_1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r7_1<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> r3_2<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r4_2<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r5_2<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r6_2<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> r7_2<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>

<span class="token comment">/*线程锁*/</span>
pthread_mutex_t g_mutex <span class="token operator">=</span> PTHREAD_MUTEX_INITIALIZER<span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>

<span class="token comment">/*线程1变量*/</span>
<span class="token keyword">int</span> head_1<span class="token punctuation">;</span>
<span class="token keyword">int</span> canReach1_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> canReach2_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
Node layer_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> ptp1_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> ptp2_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">bool</span> vis_1<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> path_1<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span><span class="token punctuation">,</span> pay_1<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>

<span class="token comment">/*线程2变量*/</span>
<span class="token keyword">int</span> head_2<span class="token punctuation">;</span>
<span class="token keyword">int</span> canReach1_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> canReach2_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
Node layer_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> ptp1_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
vector<span class="token operator">&lt;</span>Node<span class="token operator">></span> ptp2_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">bool</span> vis_2<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">int</span> path_2<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span><span class="token punctuation">,</span> pay_2<span class="token punctuation">[</span><span class="token number">7</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token comment">/**********************/</span>


uint <span class="token function">parse_1</span><span class="token punctuation">(</span><span class="token keyword">char</span><span class="token operator">*</span><span class="token operator">*</span> s<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">char</span> <span class="token operator">*</span>p <span class="token operator">=</span> <span class="token operator">*</span>s<span class="token punctuation">;</span>
	uint val <span class="token operator">=</span> <span class="token operator">*</span><span class="token punctuation">(</span>p<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token char">'0'</span><span class="token punctuation">;</span>
	<span class="token keyword">while</span><span class="token punctuation">(</span><span class="token operator">*</span>p <span class="token operator">!=</span> <span class="token char">','</span><span class="token punctuation">)</span> val <span class="token operator">=</span> <span class="token number">10</span><span class="token operator">*</span>val <span class="token operator">+</span> <span class="token operator">*</span><span class="token punctuation">(</span>p<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token char">'0'</span><span class="token punctuation">;</span>
	<span class="token operator">*</span>s <span class="token operator">=</span> p<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">return</span> val<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
uint <span class="token function">parse_2</span><span class="token punctuation">(</span><span class="token keyword">char</span><span class="token operator">*</span><span class="token operator">*</span> s<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">char</span> <span class="token operator">*</span>p <span class="token operator">=</span> <span class="token operator">*</span>s<span class="token punctuation">;</span>
	uint val <span class="token operator">=</span> <span class="token operator">*</span><span class="token punctuation">(</span>p<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token char">'0'</span><span class="token punctuation">;</span>
	<span class="token keyword">while</span><span class="token punctuation">(</span><span class="token operator">*</span>p <span class="token operator">!=</span> <span class="token char">'\r'</span> <span class="token operator">&amp;&amp;</span> <span class="token operator">*</span>p <span class="token operator">!=</span> <span class="token char">'\n'</span><span class="token punctuation">)</span> val <span class="token operator">=</span> <span class="token number">10</span><span class="token operator">*</span>val <span class="token operator">+</span> <span class="token operator">*</span><span class="token punctuation">(</span>p<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token char">'0'</span><span class="token punctuation">;</span>
	<span class="token operator">*</span>s <span class="token operator">=</span> <span class="token operator">*</span>p<span class="token operator">==</span><span class="token char">'\r'</span> <span class="token operator">?</span> p<span class="token operator">+</span><span class="token number">2</span><span class="token operator">:</span>p<span class="token operator">+</span><span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">return</span> val<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">parse_to_char</span><span class="token punctuation">(</span>uint a<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span>dest<span class="token punctuation">,</span> <span class="token keyword">int</span> <span class="token operator">&amp;</span>k<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">int</span> n<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token keyword">do</span><span class="token punctuation">&#123;</span>dest<span class="token punctuation">[</span>n<span class="token operator">++</span><span class="token punctuation">]</span> <span class="token operator">=</span> a<span class="token operator">%</span><span class="token number">10</span><span class="token operator">+</span><span class="token char">'0'</span><span class="token punctuation">;</span><span class="token punctuation">&#125;</span><span class="token keyword">while</span><span class="token punctuation">(</span><span class="token punctuation">(</span>a<span class="token operator">/=</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token operator">></span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">reverse</span><span class="token punctuation">(</span>dest<span class="token punctuation">,</span> dest<span class="token operator">+</span>n<span class="token punctuation">)</span><span class="token punctuation">;</span>
	dest<span class="token punctuation">[</span>n<span class="token operator">++</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token char">','</span><span class="token punctuation">;</span>
	length<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token operator">=</span>n<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">loadData_and_createGrap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">int</span> fd <span class="token operator">=</span> <span class="token function">open</span><span class="token punctuation">(</span>testFile<span class="token punctuation">.</span><span class="token function">c_str</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> O_RDONLY<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">int</span> size <span class="token operator">=</span> <span class="token function">lseek</span><span class="token punctuation">(</span>fd<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token constant">SEEK_END</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">char</span><span class="token operator">*</span> p_map <span class="token operator">=</span><span class="token punctuation">(</span><span class="token keyword">char</span><span class="token operator">*</span><span class="token punctuation">)</span><span class="token function">mmap</span><span class="token punctuation">(</span><span class="token constant">NULL</span><span class="token punctuation">,</span> size<span class="token punctuation">,</span> PROT_READ<span class="token punctuation">,</span> MAP_PRIVATE<span class="token punctuation">,</span> fd<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">close</span><span class="token punctuation">(</span>fd<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">char</span> <span class="token operator">*</span>p <span class="token operator">=</span> p_map<span class="token punctuation">;</span>
	<span class="token keyword">int</span> n<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span>
	uint money<span class="token punctuation">[</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">while</span><span class="token punctuation">(</span><span class="token operator">*</span>p <span class="token operator">!=</span> <span class="token char">'\0'</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		inputs<span class="token punctuation">[</span>n<span class="token punctuation">]</span><span class="token operator">=</span><span class="token function">parse_1</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>p<span class="token punctuation">)</span><span class="token punctuation">;</span>
		inputs<span class="token punctuation">[</span>n<span class="token operator">+</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token function">parse_1</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>p<span class="token punctuation">)</span><span class="token punctuation">;</span>
		money<span class="token punctuation">[</span>n<span class="token operator">++</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token function">parse_2</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>p<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>accts<span class="token punctuation">,</span> inputs<span class="token punctuation">,</span> <span class="token number">4</span><span class="token operator">*</span>n<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>accts<span class="token operator">+</span>n<span class="token punctuation">,</span> inputs<span class="token operator">+</span><span class="token number">2000000</span><span class="token punctuation">,</span> <span class="token number">4</span><span class="token operator">*</span>n<span class="token punctuation">)</span><span class="token punctuation">;</span>  
	<span class="token function">sort</span><span class="token punctuation">(</span>accts<span class="token punctuation">,</span> accts<span class="token operator">+</span><span class="token number">2</span><span class="token operator">*</span>n<span class="token punctuation">)</span><span class="token punctuation">;</span>
	account_num <span class="token operator">=</span> <span class="token function">unique</span><span class="token punctuation">(</span>accts<span class="token punctuation">,</span> accts<span class="token operator">+</span><span class="token number">2</span><span class="token operator">*</span>n<span class="token punctuation">)</span> <span class="token operator">-</span> accts<span class="token punctuation">;</span>
	unordered_map<span class="token operator">&lt;</span>uint<span class="token punctuation">,</span> <span class="token keyword">int</span><span class="token operator">></span> idHash<span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> i<span class="token operator">&lt;</span>account_num<span class="token punctuation">;</span> <span class="token operator">++</span>i<span class="token punctuation">)</span> idHash<span class="token punctuation">[</span>accts<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token operator">=</span>i<span class="token punctuation">;</span>
	Node node<span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span>a<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span>b<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">,</span> m<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> i<span class="token operator">&lt;</span>n<span class="token punctuation">;</span> <span class="token operator">++</span>i<span class="token punctuation">,</span><span class="token operator">++</span>m<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		a<span class="token operator">=</span>idHash<span class="token punctuation">[</span>inputs<span class="token punctuation">[</span>i<span class="token operator">+</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		b<span class="token operator">=</span>idHash<span class="token punctuation">[</span>inputs<span class="token punctuation">[</span>i<span class="token operator">+</span><span class="token number">2000000</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>a<span class="token operator">==</span>b<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		G<span class="token punctuation">[</span>a<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>b<span class="token punctuation">,</span>money<span class="token punctuation">[</span>m<span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		RG<span class="token punctuation">[</span>b<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>a<span class="token punctuation">,</span>money<span class="token punctuation">[</span>m<span class="token punctuation">]</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> i<span class="token operator">&lt;</span>account_num<span class="token punctuation">;</span> <span class="token operator">++</span>i<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token function">sort</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">sort</span><span class="token punctuation">(</span>RG<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>RG<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">parse_to_char</span><span class="token punctuation">(</span>accts<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span> i<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token function">munmap</span><span class="token punctuation">(</span>p_map<span class="token punctuation">,</span> size<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token keyword">inline</span> <span class="token keyword">bool</span> <span class="token function">check</span><span class="token punctuation">(</span><span class="token keyword">const</span> uint <span class="token operator">&amp;</span>x<span class="token punctuation">,</span> <span class="token keyword">const</span> uint <span class="token operator">&amp;</span>y<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">return</span> x<span class="token operator">&lt;=</span><span class="token number">5ll</span><span class="token operator">*</span>y <span class="token operator">&amp;&amp;</span> y<span class="token operator">&lt;=</span><span class="token number">3ll</span><span class="token operator">*</span>x<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token comment">/*线程1，从前往后寻环*/</span>
<span class="token keyword">void</span> <span class="token function">adpth3_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py3<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos <span class="token operator">=</span> canReach1_1<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>ptp1_1<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py1<span class="token punctuation">,</span>node<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		py3 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>money<span class="token punctuation">,</span>py3<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py3<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf3<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf3<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf3<span class="token operator">+=</span>length<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token operator">*</span><span class="token punctuation">(</span>hf3<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
		r3_1<span class="token operator">++</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth4_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py2<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py4<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos <span class="token operator">=</span> canReach1_1<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>ptp1_1<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py2<span class="token punctuation">,</span>node<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span>node<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		py4 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>money<span class="token punctuation">,</span>py4<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py4<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf4<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf4<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf4<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token function">memcpy</span><span class="token punctuation">(</span>hf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf4<span class="token operator">+=</span>length<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token operator">*</span><span class="token punctuation">(</span>hf4<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
		r4_1<span class="token operator">++</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth5_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py2<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py5<span class="token punctuation">;</span>
	<span class="token keyword">int</span> <span class="token operator">&amp;</span>pos2 <span class="token operator">=</span> canReach2_1<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node2<span class="token operator">:</span>ptp2_1<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py2<span class="token punctuation">,</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>pos1 <span class="token operator">=</span> canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node1<span class="token operator">:</span>ptp1_1<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">,</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py5 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">,</span>py5<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py5<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token function">memcpy</span><span class="token punctuation">(</span>hf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf5<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf5<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf5<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf5<span class="token operator">+=</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf5<span class="token operator">+=</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>hf5<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			r5_1<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth6_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py3<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py6<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos2 <span class="token operator">=</span> canReach2_1<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node2<span class="token operator">:</span>ptp2_1<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py3<span class="token punctuation">,</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> pos1 <span class="token operator">=</span> canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node1<span class="token operator">:</span>ptp1_1<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">,</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py6 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">,</span>py6<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py6<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf6<span class="token operator">+=</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>hf6<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			r6_1<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth7_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py4<span class="token operator">=</span>pay_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py7<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos2 <span class="token operator">=</span> canReach2_1<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node2<span class="token operator">:</span>ptp2_1<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py4<span class="token punctuation">,</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> pos1 <span class="token operator">=</span> canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node1<span class="token operator">:</span>ptp1_1<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">,</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py7 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>node1<span class="token punctuation">.</span>money<span class="token punctuation">,</span>py7<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py7<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>path_1<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
		    <span class="token function">memcpy</span><span class="token punctuation">(</span>hf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span> hf7<span class="token operator">+=</span>length<span class="token punctuation">[</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>hf7<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			r7_1<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep4_1</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>node<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_1<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token operator">=</span>node<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span>node<span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
            <span class="token function">adpth7_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep3_1</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>node<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_1<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span>node<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token operator">=</span> node<span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
            <span class="token function">adpth6_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
		<span class="token function">dep4_1</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep2_1</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>node<span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_1<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token operator">=</span> node<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> node<span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token function">adpth4_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
			<span class="token function">adpth5_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			vis_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
		<span class="token function">dep3_1</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep1_1</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node<span class="token operator">:</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>u<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_1<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> node<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> node<span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_1<span class="token punctuation">[</span>node<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>u<span class="token punctuation">)</span> <span class="token function">adpth3_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">dep2_1</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_1<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">solve_1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">auto</span> start <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">bool</span> flag <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
	<span class="token function">memset</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>vis_1<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> i<span class="token operator">&lt;</span>account_num<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>canReach1_1<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>canReach2_1<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token punctuation">&#125;</span>
	Node tmp<span class="token punctuation">;</span>
	<span class="token keyword">int</span> headPos<span class="token punctuation">,</span>layerSize<span class="token punctuation">,</span>layerPos<span class="token punctuation">;</span>
	<span class="token keyword">while</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token function">pthread_mutex_lock</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>g_mutex<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span>head_2 <span class="token operator">-</span> head_1<span class="token punctuation">)</span> <span class="token operator">&lt;=</span> <span class="token number">1</span><span class="token punctuation">)</span> flag<span class="token operator">=</span><span class="token boolean">true</span><span class="token punctuation">;</span> <span class="token comment">//判断后一个顶点是否被线2计算过</span>
        head_1<span class="token operator">++</span><span class="token punctuation">;</span>
        <span class="token function">pthread_mutex_unlock</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>g_mutex<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span>flag<span class="token punctuation">)</span> <span class="token keyword">break</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>head_1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">&lt;</span><span class="token number">1</span> <span class="token operator">||</span> RG<span class="token punctuation">[</span>head_1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">&lt;</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		headPos <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		layerSize <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node1<span class="token operator">:</span>RG<span class="token punctuation">[</span>head_1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1 <span class="token operator">=</span> node1<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>n1<span class="token operator">&lt;</span>head_1<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node2<span class="token operator">:</span>RG<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
				<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2 <span class="token operator">=</span> node2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>n2 <span class="token operator">&lt;=</span> head_1<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">!=</span> head_1<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
					canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_1<span class="token punctuation">;</span>
					canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> headPos<span class="token punctuation">;</span>
					ptp1_1<span class="token punctuation">[</span>headPos<span class="token operator">++</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
					layer_1<span class="token punctuation">[</span>layerSize<span class="token operator">++</span><span class="token punctuation">]</span> <span class="token operator">=</span> node2<span class="token punctuation">;</span>
				<span class="token punctuation">&#125;</span>
				ptp1_1<span class="token punctuation">[</span>canReach1_1<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">,</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">&#125;</span>
		<span class="token punctuation">&#125;</span>
		layerPos <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token function">sort</span><span class="token punctuation">(</span>layer_1<span class="token punctuation">,</span> layer_1<span class="token operator">+</span>layerSize<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> k<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> k<span class="token operator">&lt;</span>layerSize<span class="token punctuation">;</span> <span class="token operator">++</span>k<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			Node <span class="token operator">&amp;</span>node2 <span class="token operator">=</span> layer_1<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">;</span>
			<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node3<span class="token operator">:</span>RG<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
				<span class="token keyword">int</span> <span class="token operator">&amp;</span>n3 <span class="token operator">=</span> node3<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>n3<span class="token operator">&lt;=</span>head_1<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_1<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">!=</span> head_1<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
					canReach2_1<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_1<span class="token punctuation">;</span>
					canReach2_1<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> layerPos<span class="token punctuation">;</span>
					ptp2_1<span class="token punctuation">[</span>layerPos<span class="token operator">++</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
				<span class="token punctuation">&#125;</span>
				ptp2_1<span class="token punctuation">[</span>canReach2_1<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">,</span>node3<span class="token punctuation">.</span>money<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">&#125;</span>
		<span class="token punctuation">&#125;</span>
		path_1<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_1<span class="token punctuation">;</span>
		<span class="token function">dep1_1</span><span class="token punctuation">(</span>head_1<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token keyword">auto</span> end <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">double</span> cost_t <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span><span class="token generic-function"><span class="token function">duration</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token keyword">double</span><span class="token punctuation">,</span>std<span class="token double-colon punctuation">::</span>milli<span class="token operator">></span></span></span><span class="token punctuation">(</span>end<span class="token operator">-</span>start<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">count</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">1000</span><span class="token punctuation">;</span>
	cout <span class="token operator">&lt;&lt;</span> <span class="token string">"solve_1 -const- : "</span> <span class="token operator">&lt;&lt;</span> cost_t  <span class="token operator">&lt;&lt;</span> <span class="token string">"s"</span> <span class="token operator">&lt;&lt;</span><span class="token string">"       head_1 = "</span><span class="token operator">&lt;&lt;</span>head_1<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token comment">/*线程2，从后往前寻环，并逆序存入*/</span>
<span class="token keyword">void</span> <span class="token function">adpth3_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py3<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos <span class="token operator">=</span> canReach1_2<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>ptp1_2<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>ptp1_2<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py1<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		py3 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span>py3<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py3<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		tf3<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token operator">*</span><span class="token punctuation">(</span>tf3<span class="token operator">+</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
		tf3<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		tf3<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf3<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		r3_2<span class="token operator">++</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth4_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py2<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py4<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos <span class="token operator">=</span> canReach1_2<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>ptp1_2<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>ptp1_2<span class="token punctuation">[</span>pos<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py2<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		py4 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span>py4<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py4<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		tf4<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token operator">*</span><span class="token punctuation">(</span>tf4<span class="token operator">+</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
		tf4<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		tf4<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		tf4<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf4<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		r4_2<span class="token operator">++</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth5_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py2<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py5<span class="token punctuation">;</span>
	<span class="token keyword">int</span> <span class="token operator">&amp;</span>pos2 <span class="token operator">=</span> canReach2_2<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node2<span class="token operator">=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node2<span class="token operator">!=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node2<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py2<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>pos1 <span class="token operator">=</span> canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node1<span class="token operator">=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node1<span class="token operator">!=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node1<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py5 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span>py5<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py5<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			tf5<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>tf5<span class="token operator">+</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			tf5<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf5<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf5<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf5<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf5<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			r5_2<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth6_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py3<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py6<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos2 <span class="token operator">=</span> canReach2_2<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node2<span class="token operator">=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node2<span class="token operator">!=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node2<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py3<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> pos1 <span class="token operator">=</span> canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node1<span class="token operator">=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node1<span class="token operator">!=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node1<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py6 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span>py6<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py6<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>tf6<span class="token operator">+</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf6<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf6<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			r6_2<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">adpth7_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	uint py1<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py4<span class="token operator">=</span>pay_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">,</span>py7<span class="token punctuation">;</span>
	<span class="token keyword">int</span> pos2 <span class="token operator">=</span> canReach2_2<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node2<span class="token operator">=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node2<span class="token operator">!=</span>ptp2_2<span class="token punctuation">[</span>pos2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node2<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py4<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> pos1 <span class="token operator">=</span> canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node1<span class="token operator">=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node1<span class="token operator">!=</span>ptp1_2<span class="token punctuation">[</span>pos1<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node1<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1<span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			py7 <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span><span class="token function">find</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">begin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>G<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">end</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> Node<span class="token punctuation">&#123;</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">,</span>py7<span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>py7<span class="token punctuation">,</span>py1<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			tf7 <span class="token operator">-=</span> length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token operator">*</span><span class="token punctuation">(</span>tf7<span class="token operator">+</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node1<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">=</span> <span class="token char">'\n'</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node2<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			tf7<span class="token operator">-=</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token function">memcpy</span><span class="token punctuation">(</span>tf7<span class="token punctuation">,</span>account_chars<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">,</span>length<span class="token punctuation">[</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			r7_2<span class="token operator">++</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep4_2</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_2<span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
            <span class="token function">adpth7_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
	<span class="token punctuation">&#125;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep3_2</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_2<span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
            <span class="token function">adpth6_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
		<span class="token function">dep4_2</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep2_2</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">||</span> vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span><span class="token function">check</span><span class="token punctuation">(</span>pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_2<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span> <span class="token function">adpth4_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
			<span class="token function">adpth5_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			vis_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token punctuation">&#125;</span>
		<span class="token function">dep3_2</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">dep1_2</span><span class="token punctuation">(</span><span class="token keyword">int</span> <span class="token operator">&amp;</span>u<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">auto</span> node<span class="token operator">=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rbegin</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> node<span class="token operator">!=</span>G<span class="token punctuation">[</span>u<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">rend</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">++</span>node<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token operator">&lt;=</span>u<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		path_2<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">;</span>
		pay_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>money<span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_2<span class="token punctuation">[</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">==</span>u<span class="token punctuation">)</span> <span class="token function">adpth3_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">dep2_2</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token operator">*</span>node<span class="token punctuation">)</span><span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	vis_2<span class="token punctuation">[</span>u<span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>
<span class="token keyword">void</span> <span class="token function">solve_2</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">auto</span> start <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">bool</span> flag <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
	<span class="token function">memset</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>vis_2<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> i<span class="token operator">&lt;</span>account_num<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>canReach1_2<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>canReach2_2<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token operator">=</span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span><span class="token punctuation">&#125;</span>
	Node tmp<span class="token punctuation">;</span>
	<span class="token keyword">int</span> headPos<span class="token punctuation">,</span>layerSize<span class="token punctuation">,</span>layerPos<span class="token punctuation">;</span>
	<span class="token keyword">while</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
		<span class="token function">pthread_mutex_lock</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>g_mutex<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token punctuation">(</span>head_2 <span class="token operator">-</span> head_1<span class="token punctuation">)</span> <span class="token operator">&lt;=</span> <span class="token number">1</span><span class="token punctuation">)</span> flag<span class="token operator">=</span><span class="token boolean">true</span><span class="token punctuation">;</span>  <span class="token comment">//判断前一个顶点是否被线1计算过</span>
        head_2<span class="token operator">--</span><span class="token punctuation">;</span>
        <span class="token function">pthread_mutex_unlock</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>g_mutex<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span>flag<span class="token punctuation">)</span> <span class="token keyword">break</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>G<span class="token punctuation">[</span>head_2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">&lt;</span><span class="token number">1</span> <span class="token operator">||</span> RG<span class="token punctuation">[</span>head_2<span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">&lt;</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		headPos <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		layerSize <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node1<span class="token operator">:</span>RG<span class="token punctuation">[</span>head_2<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			<span class="token keyword">int</span> <span class="token operator">&amp;</span>n1 <span class="token operator">=</span> node1<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>n1<span class="token operator">&lt;</span>head_2<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
			<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node2<span class="token operator">:</span>RG<span class="token punctuation">[</span>n1<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
				<span class="token keyword">int</span> <span class="token operator">&amp;</span>n2 <span class="token operator">=</span> node2<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>n2 <span class="token operator">&lt;=</span> head_2<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">!=</span> head_2<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
					canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_2<span class="token punctuation">;</span>
					canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> headPos<span class="token punctuation">;</span>
					ptp1_2<span class="token punctuation">[</span>headPos<span class="token operator">++</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
					layer_2<span class="token punctuation">[</span>layerSize<span class="token operator">++</span><span class="token punctuation">]</span> <span class="token operator">=</span> node2<span class="token punctuation">;</span>
				<span class="token punctuation">&#125;</span>
				ptp1_2<span class="token punctuation">[</span>canReach1_2<span class="token punctuation">[</span>n2<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>node1<span class="token punctuation">.</span>id<span class="token punctuation">,</span>node2<span class="token punctuation">.</span>money<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">&#125;</span>
		<span class="token punctuation">&#125;</span>
		layerPos <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token function">sort</span><span class="token punctuation">(</span>layer_2<span class="token punctuation">,</span> layer_2<span class="token operator">+</span>layerSize<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> k<span class="token operator">=</span><span class="token number">0</span><span class="token punctuation">;</span> k<span class="token operator">&lt;</span>layerSize<span class="token punctuation">;</span> <span class="token operator">++</span>k<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
			Node <span class="token operator">&amp;</span>node2 <span class="token operator">=</span> layer_2<span class="token punctuation">[</span>k<span class="token punctuation">]</span><span class="token punctuation">;</span>
			<span class="token keyword">for</span><span class="token punctuation">(</span>Node <span class="token operator">&amp;</span>node3<span class="token operator">:</span>RG<span class="token punctuation">[</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
				<span class="token keyword">int</span> <span class="token operator">&amp;</span>n3 <span class="token operator">=</span> node3<span class="token punctuation">.</span>id<span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>n3<span class="token operator">&lt;=</span>head_2<span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>canReach2_2<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">!=</span> head_2<span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
					canReach2_2<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_2<span class="token punctuation">;</span>
					canReach2_2<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> layerPos<span class="token punctuation">;</span>
					ptp2_2<span class="token punctuation">[</span>layerPos<span class="token operator">++</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
				<span class="token punctuation">&#125;</span>
				ptp2_2<span class="token punctuation">[</span>canReach2_2<span class="token punctuation">[</span>n3<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">push_back</span><span class="token punctuation">(</span>Node<span class="token punctuation">&#123;</span>node2<span class="token punctuation">.</span>id<span class="token punctuation">,</span>node3<span class="token punctuation">.</span>money<span class="token punctuation">&#125;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">&#125;</span>
		<span class="token punctuation">&#125;</span>
		path_2<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> head_2<span class="token punctuation">;</span>
		<span class="token function">dep1_2</span><span class="token punctuation">(</span>head_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">&#125;</span>
	<span class="token keyword">auto</span> end <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">double</span> cost_t <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span><span class="token generic-function"><span class="token function">duration</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token keyword">double</span><span class="token punctuation">,</span>std<span class="token double-colon punctuation">::</span>milli<span class="token operator">></span></span></span><span class="token punctuation">(</span>end<span class="token operator">-</span>start<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">count</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">1000</span><span class="token punctuation">;</span>
	cout <span class="token operator">&lt;&lt;</span> <span class="token string">"solve_2 -const- : "</span> <span class="token operator">&lt;&lt;</span> cost_t  <span class="token operator">&lt;&lt;</span> <span class="token string">"s"</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>


<span class="token keyword">void</span> <span class="token function">save</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	<span class="token keyword">char</span> tmp<span class="token punctuation">[</span><span class="token number">20</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> m<span class="token operator">=</span><span class="token function">sprintf</span><span class="token punctuation">(</span>tmp<span class="token punctuation">,</span><span class="token string">"%d\n"</span><span class="token punctuation">,</span>r3_1<span class="token operator">+</span>r4_1<span class="token operator">+</span>r5_1<span class="token operator">+</span>r6_1<span class="token operator">+</span>r7_1 <span class="token operator">+</span> r3_2<span class="token operator">+</span>r4_2<span class="token operator">+</span>r5_2<span class="token operator">+</span>r6_2<span class="token operator">+</span>r7_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> n<span class="token operator">=</span>m<span class="token punctuation">;</span>
	n <span class="token operator">+=</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf3<span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token punctuation">(</span>tf3 <span class="token operator">-</span> hf3<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//存放长度为3的环所用的字节数</span>
	n <span class="token operator">+=</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf4<span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token punctuation">(</span>tf4 <span class="token operator">-</span> hf4<span class="token punctuation">)</span><span class="token punctuation">;</span>
	n <span class="token operator">+=</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf5<span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token punctuation">(</span>tf5 <span class="token operator">-</span> hf5<span class="token punctuation">)</span><span class="token punctuation">;</span>
	n <span class="token operator">+=</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf6<span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token punctuation">(</span>tf6 <span class="token operator">-</span> hf6<span class="token punctuation">)</span><span class="token punctuation">;</span>
	n <span class="token operator">+=</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf7<span class="token punctuation">)</span> <span class="token operator">-</span> <span class="token punctuation">(</span>tf7 <span class="token operator">-</span> hf7<span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token keyword">int</span> fd <span class="token operator">=</span> <span class="token function">open</span><span class="token punctuation">(</span>resultFile<span class="token punctuation">.</span><span class="token function">c_str</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> O_RDWR<span class="token operator">|</span>O_CREAT<span class="token punctuation">,</span> <span class="token number">0666</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">lseek</span><span class="token punctuation">(</span>fd<span class="token punctuation">,</span> n<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token constant">SEEK_SET</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">write</span><span class="token punctuation">(</span>fd<span class="token punctuation">,</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">char</span><span class="token operator">*</span> p_mmap <span class="token operator">=</span><span class="token punctuation">(</span><span class="token keyword">char</span><span class="token operator">*</span><span class="token punctuation">)</span><span class="token function">mmap</span><span class="token punctuation">(</span><span class="token constant">NULL</span><span class="token punctuation">,</span> n<span class="token punctuation">,</span> PROT_WRITE<span class="token punctuation">,</span> MAP_SHARED<span class="token punctuation">,</span> fd<span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">char</span><span class="token operator">*</span> p <span class="token operator">=</span> p_mmap<span class="token punctuation">;</span>

	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tmp<span class="token punctuation">,</span> m<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>m<span class="token punctuation">;</span> <span class="token comment">//写入找到的环的总个数</span>
	
	<span class="token keyword">int</span> len <span class="token operator">=</span> hf3<span class="token operator">-</span>buf3<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> buf3<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	len <span class="token operator">=</span> buf3 <span class="token operator">+</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf3<span class="token punctuation">)</span> <span class="token operator">-</span> tf3<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tf3<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	
	len <span class="token operator">=</span> hf4<span class="token operator">-</span>buf4<span class="token punctuation">;</span> 
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> buf4<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	len <span class="token operator">=</span> buf4 <span class="token operator">+</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf4<span class="token punctuation">)</span> <span class="token operator">-</span> tf4<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tf4<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	
	len <span class="token operator">=</span> hf5<span class="token operator">-</span>buf5<span class="token punctuation">;</span> 
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> buf5<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	len <span class="token operator">=</span> buf5 <span class="token operator">+</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf5<span class="token punctuation">)</span> <span class="token operator">-</span> tf5<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tf5<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	
	len <span class="token operator">=</span> hf6<span class="token operator">-</span>buf6<span class="token punctuation">;</span> 
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> buf6<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	len <span class="token operator">=</span> buf6 <span class="token operator">+</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf6<span class="token punctuation">)</span> <span class="token operator">-</span> tf6<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tf6<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	
	len <span class="token operator">=</span> hf7<span class="token operator">-</span>buf7<span class="token punctuation">;</span> 
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> buf7<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	len <span class="token operator">=</span> buf7 <span class="token operator">+</span> <span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf7<span class="token punctuation">)</span> <span class="token operator">-</span> tf7<span class="token punctuation">;</span>
	<span class="token function">memcpy</span><span class="token punctuation">(</span>p<span class="token punctuation">,</span> tf7<span class="token punctuation">,</span> len<span class="token punctuation">)</span><span class="token punctuation">;</span> p<span class="token operator">+=</span>len<span class="token punctuation">;</span>
	
	<span class="token operator">*</span>p <span class="token operator">=</span> <span class="token char">'\0'</span><span class="token punctuation">;</span>
	
	<span class="token function">munmap</span><span class="token punctuation">(</span>p_mmap<span class="token punctuation">,</span> n<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">close</span><span class="token punctuation">(</span>fd<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span>

<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span><span class="token operator">*</span> argv<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">&#123;</span>
	clock_t startTime <span class="token operator">=</span> <span class="token function">clock</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">loadData_and_createGrap</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	clock_t endTime <span class="token operator">=</span> <span class="token function">clock</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	cout <span class="token operator">&lt;&lt;</span> <span class="token string">"LoadDataAndCreateGraph: "</span> <span class="token operator">&lt;&lt;</span> <span class="token punctuation">(</span><span class="token keyword">float</span><span class="token punctuation">)</span><span class="token punctuation">(</span>endTime <span class="token operator">-</span> startTime<span class="token punctuation">)</span> <span class="token operator">/</span> CLOCKS_PER_SEC <span class="token operator">&lt;&lt;</span> <span class="token string">" s"</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
	
	hf3<span class="token operator">=</span>buf3<span class="token punctuation">;</span>tf3<span class="token operator">=</span>buf3<span class="token operator">+</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf3<span class="token punctuation">)</span><span class="token punctuation">;</span>
	hf4<span class="token operator">=</span>buf4<span class="token punctuation">;</span>tf4<span class="token operator">=</span>buf4<span class="token operator">+</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf4<span class="token punctuation">)</span><span class="token punctuation">;</span>
	hf5<span class="token operator">=</span>buf5<span class="token punctuation">;</span>tf5<span class="token operator">=</span>buf5<span class="token operator">+</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf5<span class="token punctuation">)</span><span class="token punctuation">;</span>
	hf6<span class="token operator">=</span>buf6<span class="token punctuation">;</span>tf6<span class="token operator">=</span>buf6<span class="token operator">+</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf6<span class="token punctuation">)</span><span class="token punctuation">;</span>
	hf7<span class="token operator">=</span>buf7<span class="token punctuation">;</span>tf7<span class="token operator">=</span>buf7<span class="token operator">+</span><span class="token keyword">sizeof</span><span class="token punctuation">(</span>buf7<span class="token punctuation">)</span><span class="token punctuation">;</span>
	head_1 <span class="token operator">=</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">;</span>
	head_2 <span class="token operator">=</span>account_num<span class="token punctuation">;</span>
	<span class="token keyword">auto</span> start <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	vector<span class="token operator">&lt;</span>thread<span class="token operator">></span> <span class="token function">threadpool</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	threadpool<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token function">thread</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>solve_1<span class="token punctuation">)</span><span class="token punctuation">;</span>
	threadpool<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token function">thread</span><span class="token punctuation">(</span><span class="token operator">&amp;</span>solve_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	threadpool<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	threadpool<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token function">join</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">auto</span> end <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span>steady_clock<span class="token double-colon punctuation">::</span><span class="token function">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">double</span> cost_t <span class="token operator">=</span> chrono<span class="token double-colon punctuation">::</span><span class="token generic-function"><span class="token function">duration</span><span class="token generic class-name"><span class="token operator">&lt;</span><span class="token keyword">double</span><span class="token punctuation">,</span>std<span class="token double-colon punctuation">::</span>milli<span class="token operator">></span></span></span><span class="token punctuation">(</span>end<span class="token operator">-</span>start<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">count</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">/</span><span class="token number">1000</span><span class="token punctuation">;</span>
	cout <span class="token operator">&lt;&lt;</span> <span class="token string">"compute : "</span> <span class="token operator">&lt;&lt;</span> cost_t  <span class="token operator">&lt;&lt;</span> <span class="token string">"s"</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
	
	
	startTime <span class="token operator">=</span> <span class="token function">clock</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token function">save</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	endTime <span class="token operator">=</span> <span class="token function">clock</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	cout <span class="token operator">&lt;&lt;</span> <span class="token string">"save: "</span> <span class="token operator">&lt;&lt;</span> <span class="token punctuation">(</span><span class="token keyword">float</span><span class="token punctuation">)</span><span class="token punctuation">(</span>endTime <span class="token operator">-</span> startTime<span class="token punctuation">)</span> <span class="token operator">/</span> CLOCKS_PER_SEC <span class="token operator">&lt;&lt;</span> <span class="token string">" s"</span> <span class="token operator">&lt;&lt;</span> endl<span class="token punctuation">;</span>
	
	
	cout<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p3_1 = "</span><span class="token operator">&lt;&lt;</span>r3_1<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p4_1 = "</span><span class="token operator">&lt;&lt;</span>r4_1<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p5_1 = "</span><span class="token operator">&lt;&lt;</span>r5_1<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p6_1 = "</span><span class="token operator">&lt;&lt;</span>r6_1<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p7_1 = "</span><span class="token operator">&lt;&lt;</span>r7_1<span class="token operator">&lt;&lt;</span>endl<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p3_2 = "</span><span class="token operator">&lt;&lt;</span>r3_2<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p4_2 = "</span><span class="token operator">&lt;&lt;</span>r4_2<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p5_2 = "</span><span class="token operator">&lt;&lt;</span>r5_2<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p6_2 = "</span><span class="token operator">&lt;&lt;</span>r6_2<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"p7_2 = "</span><span class="token operator">&lt;&lt;</span>r7_2<span class="token operator">&lt;&lt;</span>endl<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	<span class="token keyword">int</span> all <span class="token operator">=</span> r3_1<span class="token operator">+</span>r4_1<span class="token operator">+</span>r5_1<span class="token operator">+</span>r6_1<span class="token operator">+</span>r7_1<span class="token punctuation">;</span>
	all    <span class="token operator">+=</span> r3_2<span class="token operator">+</span>r4_2<span class="token operator">+</span>r5_2<span class="token operator">+</span>r6_2<span class="token operator">+</span>r7_2<span class="token punctuation">;</span>
	cout<span class="token operator">&lt;&lt;</span><span class="token string">"all_loops = "</span><span class="token operator">&lt;&lt;</span>all<span class="token operator">&lt;&lt;</span>endl<span class="token punctuation">;</span>
	<span class="token function">exit</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">&#125;</span></code></pre>

                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">YangChongZhi</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://yczlab.top/posts/4c44f972.html">http://yczlab.top/posts/4c44f972.html</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">YangChongZhi</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/%E6%AF%94%E8%B5%9B/">
                                    <span class="chip bg-color">比赛</span>
                                </a>
                            
                                <a href="/tags/C/">
                                    <span class="chip bg-color">C++</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    
        <style>
    .valine-card {
        margin: 1.5rem auto;
    }

    .valine-card .card-content {
        padding: 20px 20px 5px 20px;
    }

    #vcomments textarea {
        box-sizing: border-box;
        background: url("/medias/comment_bg.webp") 100% 100% no-repeat;
    }

    #vcomments p {
        margin: 2px 2px 10px;
        font-size: 1.05rem;
        line-height: 1.78rem;
    }

    #vcomments blockquote p {
        text-indent: 0.2rem;
    }

    #vcomments a {
        padding: 0 2px;
        color: #4cbf30;
        font-weight: 500;
        text-decoration: none;
    }

    #vcomments img {
        max-width: 100%;
        height: auto;
        cursor: pointer;
    }

    #vcomments ol li {
        list-style-type: decimal;
    }

    #vcomments ol,
    ul {
        display: block;
        padding-left: 2em;
        word-spacing: 0.05rem;
    }

    #vcomments ul li,
    ol li {
        display: list-item;
        line-height: 1.8rem;
        font-size: 1rem;
    }

    #vcomments ul li {
        list-style-type: disc;
    }

    #vcomments ul ul li {
        list-style-type: circle;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    #vcomments table, th, td {
        border: 0;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments h1 {
        font-size: 1.85rem;
        font-weight: bold;
        line-height: 2.2rem;
    }

    #vcomments h2 {
        font-size: 1.65rem;
        font-weight: bold;
        line-height: 1.9rem;
    }

    #vcomments h3 {
        font-size: 1.45rem;
        font-weight: bold;
        line-height: 1.7rem;
    }

    #vcomments h4 {
        font-size: 1.25rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    #vcomments h5 {
        font-size: 1.1rem;
        font-weight: bold;
        line-height: 1.4rem;
    }

    #vcomments h6 {
        font-size: 1rem;
        line-height: 1.3rem;
    }

    #vcomments p {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    #vcomments hr {
        margin: 12px 0;
        border: 0;
        border-top: 1px solid #ccc;
    }

    #vcomments blockquote {
        margin: 15px 0;
        border-left: 5px solid #42b983;
        padding: 1rem 0.8rem 0.3rem 0.8rem;
        color: #666;
        background-color: rgba(66, 185, 131, .1);
    }

    #vcomments pre {
        font-family: monospace, monospace;
        padding: 1.2em;
        margin: .5em 0;
        background: #272822;
        overflow: auto;
        border-radius: 0.3em;
        tab-size: 4;
    }

    #vcomments code {
        font-family: monospace, monospace;
        padding: 1px 3px;
        font-size: 0.92rem;
        color: #e96900;
        background-color: #f8f8f8;
        border-radius: 2px;
    }

    #vcomments pre code {
        font-family: monospace, monospace;
        padding: 0;
        color: #e8eaf6;
        background-color: #272822;
    }

    #vcomments pre[class*="language-"] {
        padding: 1.2em;
        margin: .5em 0;
    }

    #vcomments code[class*="language-"],
    pre[class*="language-"] {
        color: #e8eaf6;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }

    #vcomments b,
    strong {
        font-weight: bold;
    }

    #vcomments dfn {
        font-style: italic;
    }

    #vcomments small {
        font-size: 85%;
    }

    #vcomments cite {
        font-style: normal;
    }

    #vcomments mark {
        background-color: #fcf8e3;
        padding: .2em;
    }

    #vcomments table, th, td {
        padding: 12px 13px;
        border: 1px solid #dfe2e5;
    }

    table tr:nth-child(2n), thead {
        background-color: #fafafa;
    }

    #vcomments table th {
        background-color: #f2f2f2;
        min-width: 80px;
    }

    #vcomments table td {
        min-width: 80px;
    }

    #vcomments [type="checkbox"]:not(:checked), [type="checkbox"]:checked {
        position: inherit;
        margin-left: -1.3rem;
        margin-right: 0.4rem;
        margin-top: -1px;
        vertical-align: middle;
        left: unset;
        visibility: visible;
    }
</style>

<div class="card valine-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; padding-left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="vcomments" class="card-content" style="display: grid">
    </div>
</div>

<script src="/libs/valine/av-min.js"></script>
<script src="/libs/valine/Valine.min.js"></script>
<script>
    new Valine({
        el: '#vcomments',
        appId: 'jJDtz1MXtl9cRxLcrXYvlvhd-9Nh9j0Va',
        appKey: 'UpF6BuVYYhInv6M8vXS0dWRt',
        pageSize: '10',
        notify: 'false' === 'true',
        verify: 'false' === 'true',
        visitor: 'false' === 'true',
        avatar: 'monsterid',
		recordIP: 'true',
		enableQQ: 'true',
		requiredFields: ["nick", "mail"],
        lang: 'zh-cn',
        placeholder: '请开始你的表演吧！\n注意博客留言要求填写昵称、邮箱'
    });
</script>

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/posts/c2186e0.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/6.jpg" class="responsive-img" alt="阿里云Centos7中安装mysql教程">
                        
                        <span class="card-title">阿里云Centos7中安装mysql教程</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            引言：
如何在Centos中成功安装配置MySql

1 基本安装过程1.查看系统是否安装了mysql软件
# rpm -qa|grep -i mysql

2.将已经安装过的软件卸载掉。注意：这样的卸载是不彻底，不过这里够用了
# yum
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-05-30
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/EnvConfig/" class="post-category">
                                    EnvConfig
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/CentOS/">
                        <span class="chip bg-color">CentOS</span>
                    </a>
                    
                    <a href="/tags/Linux/">
                        <span class="chip bg-color">Linux</span>
                    </a>
                    
                    <a href="/tags/EnvConfig/">
                        <span class="chip bg-color">EnvConfig</span>
                    </a>
                    
                    <a href="/tags/MySql/">
                        <span class="chip bg-color">MySql</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/posts/de8d44af.html">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/9.jpg" class="responsive-img" alt="收集常用的网站(持续更新...)">
                        
                        <span class="card-title">收集常用的网站(持续更新...)</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            引言：
对一些常用网站的收集(主要是为了方便自己换电脑时懒得去导出浏览器收藏夹)，会持续更新…

常用网站
软件安装管家（能找到满足日常办公的很多软件）
chm格式的java API制作工具
浏览器主页“简法主页”
浏览器主页插件 itab
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-03-31
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/Diary/" class="post-category">
                                    Diary
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/Diary/">
                        <span class="chip bg-color">Diary</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="7565528433"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.4'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 15px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2019-2024</span>
            
            <span id="year">2019</span>
            <a href="/about" target="_blank">YangChongZhi</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">236.5k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <span id="sitetime">载入运行时间...</span>
            <script>
                function siteTime() {
                    var seconds = 1000;
                    var minutes = seconds * 60;
                    var hours = minutes * 60;
                    var days = hours * 24;
                    var years = days * 365;
                    var today = new Date();
                    var startYear = "2019";
                    var startMonth = "6";
                    var startDate = "28";
                    var startHour = "0";
                    var startMinute = "0";
                    var startSecond = "0";
                    var todayYear = today.getFullYear();
                    var todayMonth = today.getMonth() + 1;
                    var todayDate = today.getDate();
                    var todayHour = today.getHours();
                    var todayMinute = today.getMinutes();
                    var todaySecond = today.getSeconds();
                    var t1 = Date.UTC(startYear, startMonth, startDate, startHour, startMinute, startSecond);
                    var t2 = Date.UTC(todayYear, todayMonth, todayDate, todayHour, todayMinute, todaySecond);
                    var diff = t2 - t1;
                    var diffYears = Math.floor(diff / years);
                    var diffDays = Math.floor((diff / days) - diffYears * 365);
                    var diffHours = Math.floor((diff - (diffYears * 365 + diffDays) * days) / hours);
                    var diffMinutes = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours) /
                        minutes);
                    var diffSeconds = Math.floor((diff - (diffYears * 365 + diffDays) * days - diffHours * hours -
                        diffMinutes * minutes) / seconds);
                    if (startYear == todayYear) {
                        document.getElementById("year").innerHTML = todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffDays + " 天 " + diffHours +
                            " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    } else {
                        document.getElementById("year").innerHTML = startYear + " - " + todayYear;
                        document.getElementById("sitetime").innerHTML = "本站已安全运行 " + diffYears + " 年 " + diffDays +
                            " 天 " + diffHours + " 小时 " + diffMinutes + " 分钟 " + diffSeconds + " 秒";
                    }
                }
                setInterval(siteTime, 1000);
            </script>
            
            <br>
            
            <span id="icp"><img src="/medias/icp.png" style="vertical-align: text-bottom;" />
                <a href="http://beian.miit.gov.cn/" target="_blank">渝ICP备2021001798号-1</a>
            </span>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/yczlab" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="https://gitee.com/yczlab" class="tooltipped" target="_blank" data-tooltip="访问我的码云" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:2685733832@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2685733832" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 2685733832" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2685733832" class="tooltipped" target="_blank" data-tooltip="微信联系我: yczlab" data-position="top" data-delay="50">
        <i class="fab fa-weixin"></i>
    </a>



    <a href="https://weibo.com/yczlab" class="tooltipped" target="_blank" data-tooltip="关注我的微博: https://weibo.com/yczlab" data-position="top" data-delay="50">
        <i class="fab fa-weibo"></i>
    </a>



    <a href="https://www.zhihu.com/people/yczlab" class="tooltipped" target="_blank" data-tooltip="关注我的知乎: https://www.zhihu.com/people/yczlab" data-position="top" data-delay="50">
        <i class="fab fa-zhihu1">知</i>
    </a>



</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    
        <script src="//code.tidio.co/ef3vil8uaqrvp7giqeg545xldzmymqss.js"></script>
    

    

	
    
    <script type="text/javascript" color="0,0,255"
        pointColor="0,0,255" opacity='0.5'
        zIndex="-1" count="99"
        src="/libs/background/canvas-nest.js"></script>
    

    
    
    <script type="text/javascript" size="150" alpha='0.6'
        zIndex="-1" src="/libs/background/ribbon-refresh.min.js" async="async"></script>
    

    
    <script type="text/javascript" src="/libs/background/ribbon-dynamic.js" async="async"></script>
    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    
	
	<script type="text/javascript">
	var OriginTitile = document.title,st;
	document.addEventListener("visibilitychange", function () {
		document.hidden ? (document.title = "Σ(っ °Д °;)っ我隐藏了！", clearTimeout(st)) : (document.title="(๑•̀ㅂ•́) ✧被发现了！", st=setTimeout(function () {document.title = OriginTitile}, 3e3))
	});
	</script>
	
	<!-- 背景樱花飘落特效 -->
	
	
	<!-- 背景雪花飘落特效 -->
	
	
	<!-- 数字雨特效 -->
	
		<script type="text/javascript">
		//只在桌面版网页启用特效
		var windowWidth = $(window).width();
		if (windowWidth > 768) {
			document.write('<canvas id="digitalrain" width="1440" height="900" style="position:fixed; z-index:-2; right:0px; bottom:0px; min-width:100%; min-height:100%; height:auto; width:auto;"><\/canvas>');
			document.write('<script type="text/javascript" src="/js/digitalrain.js"><\/script>');
		}
		</script>
	

</body>

</html>
